package com.zuxia.dao.impl;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.zuxia.dao.ICarDao;
import com.zuxia.entity.Car;

@Component
public class CarDao implements ICarDao{

	@Autowired
	private SessionFactory sf;
	
	@Override
	public List<Car> selectCar() {
		// TODO Auto-generated method stub
		Session session = sf.getCurrentSession();
		Criteria create = session.createCriteria(Car.class);
		return create.list();
	}

}
